<template>
    <div class="main-content" :style="{width: $root.elderMode ? '80%' : '60%'}">
      <div class="card">
        <div :style="{fontSize: $root.elderMode ? '28px' : '22px'}">{{ news.title }}</div>
        <div :style="{margin: $root.elderMode ? '30px 0' : '20px 0', padding: $root.elderMode ? '0 40px' : '0 20px'}">
          <div class="w-e-text" :style="{lineHeight: $root.elderMode ? '2' : '1.6', fontSize: $root.elderMode ? '20px' : '16px'}">
                <div v-html="news.content"></div>
              </div>
            </div>
        </div>

      <Comment :fid="id" module="news" :style="{marginTop: $root.elderMode ? '40px' : '20px'}"/>  

    </div>
</template>

<script>
import Comment from "@/components/Comment"
export default {
    name:"NewsDetail",
    components: {Comment},
    data(){
        return{
            id:this.$route.query.id,
            news:{},
        }
    },
    created(){
        this.$request.put('/news/updateCount/'+this.id).then(res =>{
            this.load() //查出数据
        })
    },
    methods:{
        load(){
            this.$request.get('/news/selectById/' + this.id).then(res => {
                this.news = res.data || {}
            })
        }
    }
}
</script>

<style scoped>

</style>